const storageService = require('./storage')

/**
 * 
 * @param {string} id 
 * @returns {boolean} 是否存在已启用的task
 */
function disableAdvancedCurves(id) {
  const advancedModeData = storageService.getAdvancedModeData(id)
  const curves = advancedModeData?.curves || []
  let flag = false
  curves.forEach(curve => {
    if (curve.enabled) {
      curve.enabled = false
      flag = true
    }
  })
  if (flag) {
    storageService.saveAdvancedModeData(id, {
      curves: curves
    })
  }
  return flag
}



module.exports = {
  disableAdvancedCurves,
}